package com.flex.core.model;

import java.util.Date;

import javax.persistence.MappedSuperclass;

/**
 * model的父类,定义了model的创建时间和更新时间，默认为当前时间。
 * 必须子类继承使用,此类继承于AbstractIdEntity，拥有ID属性
 * 
 * @author radio
 *
 */
@MappedSuperclass
public abstract class AbstractTimeEntity extends AbstractIdEntity {

	private static final long serialVersionUID = 3303054758723102256L;

	Date now = new Date();

	protected Date createTime = now;

	protected Date updateTime = now;

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}
